package org.xg.study.pd;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * @author CMG
 * @version 1.0
 * @description 审核规定；
 * * 1. 601-610 三级审批 + 二级审批
 * * 2. 611-620 三级审批 + 二级审批 + 一级审批
 * * 3. 其他时间 三级审批
 * @cLassName AuthLink
 * @date 2021/9/16 9:40
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
public abstract class AuthLink {
    protected Logger logger = LoggerFactory.getLogger(AuthLink.class);

    //时间格式
    protected SimpleDateFormat f = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");

    protected String levelUserId;//级别人员ID
    protected String levelUserName;//级别人员姓名
    private AuthLink next;//责任链

    public AuthLink(String levelUserId, String levelUserName) {
        this.levelUserId = levelUserId;
        this.levelUserName = levelUserName;
    }

    public AuthLink next() {
        return next;
    }

    public AuthLink appendNext(AuthLink next) {
        this.next = next;
        return this;
    }

    public abstract AuthInfo doAuth(String uId, String orderId, Date authDate);
}
